<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/template :: header(~{::title},~{::link},~{::style})">
</head>
<body>
    <div class="layui-form timo-compile">
    <form th:action="@{/components/components/save}">
        <input type="hidden" name="id" th:if="${components}" th:value="${components.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">部件名称</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="title" placeholder="请输入部件名称" th:value="${components?.title}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品编码</label>
            <div class="layui-input-inline">
                <input class="layui-input selected" th:attr="data-url=@{/good/good/list}, data-value=${good?.id}" type="text" name="good_code"  placeholder="请输入商品编码" th:value="${good?.good_code}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">商品名称</label>
            <div class="layui-input-inline">
                <input type="text" placeholder="请输入商品编码" th:if="${good}" th:value="${good.name}">
                <input type="hidden" name="goodId" th:if="${good}" th:value="${good.id}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部件数量（一个商品需要该部件的总数量）</label>
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="component_num" placeholder="请输入部件数量（一个商品需要该部件的总数量）" th:value="${components?.component_num}">
            </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark">[[${components?.remark}]]</textarea>
            </div>
        </div>
        <div class="layui-form-item timo-finally">
            <button class="layui-btn ajax-submit"><i class="fa fa-check-circle"></i> 保存</button>
            <button class="layui-btn btn-secondary close-popup"><i class="fa fa-times-circle"></i> 关闭</button>
        </div>
    </form>
</div>
<script th:replace="/common/template :: script"></script>
    <script th:src="@{/js/good/good.js}" charset="utf-8"></script>

</body>
</html>